/* Copyright 2001,2002,2003 NAH6 BV
 * All Rights Reserved
 *
 *  $Header: /var/lib/cvs/secphone/ui/phone/spif.h,v 1.8 2003/11/21 12:39:24 itsme Exp $
 *
 *
 */


#ifndef __SPIF_H__

#include <string>
#include "vectorutils.h"

#include "spipc.h"

typedef unsigned char byte;
typedef unsigned short word;
typedef unsigned long dword;

// currently only using one virtual phone
#define DEFAULT_PHONE 0

char *SPIPCCommandString(int nCmd);
char *SPIPCResult(int rc);
char *SPIPCSyncStateName(int sync);
char *SPIPCDisconnectReason(int rc);

int SP_initSystem(HWND hNotifyWnd);
int SP_initPhone(int cfgtype);
int SP_stopSystem( );

int SP_dial_gsm( byte nCarrier, const std::string& number);
int SP_hangup( );
int SP_answer( );
int SP_ping( );

int SP_setEncoderKey(const ByteVector& key, bool bOriginating);
int SP_setDecoderKey(const ByteVector& key, bool bOriginating);
/*
int SP_getEncoderCounter(DWORD& counter);
int SP_getDecoderCounter(DWORD& counter);
*/
int SP_setEncoderMode(int mode);
int SP_setDecoderMode(int mode);

int SP_requestCoderStates();
int SP_setVolume(int volume);
int SP_getVolume();

int SP_sendUserData(const ByteVector& data);

int SP__sendSystemCmd( dword dwId, word nCmd, char *fmt=NULL, ... );
int SP__sendPhoneCmd( dword dwId, word nCmd, char *fmt=NULL, ... );

int SP__getMessage( word *pnCmd, dword *pdwId, word *pnDataLen, void **pData );

std::string SP_getCallerId( const SPIPC_MSG_EVT_CALLERID* pData );
short SP_getError( const SPIPC_MSG_RES_ERROR* pData );

bool MachineIsRunning();
bool FindAndStartMachine();

#define __SPIF_H__
#endif

